<?php
class My_CpartyController extends MM_Controller_Admin_Action
{	
	public function indexAction(){
		$this->helper->setPageView($this->pageview, WEB_TITLE, "cparty", null);
	}
	
	public function cityAction(){
		//db 数据不全,无法使用 by vincent 20130617
		$province = null;
		$district = null;
		$service = new MM_Service_Admin_City();
		if (isset($this->httpdata['all'])) {//取省,自治区
			$where = "code like '%0000%' and code < 700000";//不取台湾,香港
			$result = $service->fetchAll(1,999,$where);
			//echo $this->encodeResult($result);
			//var_dump( $this->encodeResult($result));
			var_dump( $result->getData());
		}
		//取市
		if (isset($this->httpdata['province'])) {//取市
			$province = $this->httpdata['province'];//110000
			if(strlen($province)!=6)return;			
			$code = $province[0].$province[1];
			$where = sprintf("code between '%s0000' and '%s0999'",$code,$code);
			$result = $service->fetchAll(1,999,$where);
			//echo $this->encodeResult($result);
			//var_dump( $this->encodeResult($result));
			var_dump( $result->getData());
		}
		//取区/县
	}
	
	//TODO
	//增加对活动拟邀的嘉宾功能
}